#region File Description
//-----------------------------------------------------------------------------
// Author: JCBDigger
// URL: http://Games.DiscoverThat.co.uk
//-----------------------------------------------------------------------------
// Changes for XNA 4 taken from the example at:
//      http://msdn.microsoft.com/en-us/library/bb976065.aspx
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Graphics.PackedVector;
using AssetData;
#endregion

namespace Engine
{
    /// <summary>
    /// Image and the name of the image.
    /// </summary>
    public class ParticleImage
    {

        private string iD = "None";
        public string Name
        {
            get { return iD; }
        }
        private Texture2D image;
        public Texture2D Image
        {
            get { return image; }
            set 
            {
                if (value != null)
                {
                    image = value;
                }
            }
        }
        /// <summary>
        /// Holder to keep the name and the image together.
        /// If a path is included it will be removed leaving just the filename.
        /// If the file name does not include an extension then .png is added.
        /// </summary>
        public ParticleImage(string fileName, Texture2D picture)
        {
            iD = System.IO.Path.GetFileName(fileName);
            if (!string.IsNullOrEmpty(iD) && !System.IO.Path.HasExtension(iD))
            {
                iD += ".png";
            }
            image = picture;
        }
    }
}
